home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / OpenBSD / comp21.tar.gz / comp21.tar / usr / include / scsi / scsi_scanner.h < prev    next >
C/C++ Source or Header  |  1997-03-17  |  4KB  |  135 lines

  1. /*    $OpenBSD: scsi_scanner.h,v 1.7 1997/03/10 02:29:39 kstailey Exp $    */
  2.  
  3. /*
  4.  * Copyright (c) 1995 Kenneth Stailey.  All rights reserved.
  5.  *   modified for configurable scanner support by Joachim Koenig
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  * 1. Redistributions of source code must retain the above copyright
  11.  *    notice, this list of conditions and the following disclaimer.
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in the
  14.  *    documentation and/or other materials provided with the distribution.
  15.  * 3. All advertising materials mentioning features or use of this software
  16.  *    must display the following acknowledgement:
  17.  *    This product includes software developed by Kenneth Stailey.
  18.  * 4. The name of the author may not be used to endorse or promote products
  19.  *    derived from this software without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  22.  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  23.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  24.  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  25.  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  26.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  30.  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31.  */
  32.  
  33. /*
  34.  * SCSI scanner interface description
  35.  */
  36.  
  37. #ifndef    _SCSI_SCANNER_H_
  38. #define _SCSI_SCANNER_H_
  39.  
  40. /* SCSI scanner commands */
  41. #define GET_IMAGE_STATUS    0x0f
  42. #define WRITE_BIG        0x2a
  43. #define OBJECT_POSITION        0x31
  44.  
  45. /* generic scanner command formats */
  46.  
  47. struct scsi_r_scanner {
  48. #define    READ_BIG        0x28
  49.     u_int8_t opcode;
  50.     u_int8_t lun:3;
  51.     u_int8_t res1:5;
  52.     u_int8_t code;
  53.     u_int8_t res2;
  54.     u_int8_t qualifier;
  55.     u_int8_t len[3];
  56.     u_int8_t control;
  57. };
  58.  
  59. struct scsi_get_buffer_status {
  60. #define GET_BUFFER_STATUS    0x34
  61.     u_int8_t opcode;
  62.     u_int8_t lun:3;
  63.     u_int8_t res1:4;
  64.     u_int8_t wait:1;
  65.     u_int8_t res2[5];
  66.     u_int8_t len[2];
  67.     u_int8_t control;
  68. };
  69.  
  70. struct scsi_rw_scanner {
  71. #define    READ            0x08
  72. #define WRITE            0x0a
  73.     u_int8_t opcode;
  74.     u_int8_t byte2;
  75. #define    SRW_FIXED        0x01
  76.     u_int8_t len[3];
  77.     u_int8_t control;
  78. };
  79.  
  80. struct scsi_start_stop {
  81.     u_int8_t opcode;
  82.     u_int8_t byte2;
  83.     u_int8_t unused[2];
  84.     u_int8_t how;
  85. #define    SSS_STOP        0x00
  86. #define    SSS_START        0x01
  87. #define    SSS_LOEJ        0x02
  88.     u_int8_t control;
  89. };
  90.  
  91. struct scsi_set_window {
  92. #define SET_WINDOW        0x24 /* set params of image area and windows */
  93. #define GET_WINDOW        0x25
  94.     u_int8_t opcode;
  95.     u_int8_t byte2;
  96.     u_int8_t reserved[4];
  97.     u_int8_t len[3];
  98.     u_int8_t control;
  99. };
  100.  
  101. struct scsi_window_data {
  102.     u_int8_t reserved[6];         /* window header */
  103.     u_int8_t window_desc_len[2]; /* ditto */
  104.     u_int8_t window_id;         /* must be zero */
  105.     u_int8_t res1:7;
  106.     u_int8_t auto_bit:1;
  107.     u_int8_t x_res[2];
  108.     u_int8_t y_res[2];
  109.     u_int8_t x_org[4];
  110.     u_int8_t y_org[4];
  111.     u_int8_t width[4];
  112.     u_int8_t length[4];
  113.     u_int8_t brightness;
  114.     u_int8_t threshold;
  115.     u_int8_t contrast;
  116.     u_int8_t image_comp;        /* image composition (data type) */
  117.     u_int8_t bits_per_pixel;
  118.     u_int8_t halftone_pattern[2];
  119.     u_int8_t rif:1;            /* reverse image format (mono negative) */
  120.     u_int8_t res2:4;
  121.     u_int8_t pad_type:3;
  122.     u_int8_t bit_ordering[2];
  123.     u_int8_t compression_type;
  124.     u_int8_t compression_arg;
  125.     u_int8_t res3[6];
  126. };
  127.  
  128. /* mustek scsi commands */
  129.  
  130. #define MUSTEK_SET_WINDOW    0x04    /* set image area and windows */
  131. #define MUSTEK_ADF        0x10    /* ADF and backtracking selection */
  132. #define MUSTEK_LUT        0x55    /* look up table download */
  133.  
  134. #endif /* _SCSI_SCANNER_H_ */
  135.